/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package database;

import java.sql.ResultSet;
import java.sql.SQLException;
import model.Usuario;

/**
 *
 * @author Guilherme
 */
public class UsuarioDB
{
    public static boolean checkLogin(Usuario u)
    {
        String s = "SELECT * FROM genesis.usuario u WHERE u.login = '" + u.getLogin() + "' AND u.pass = '" + u.getPass() + "'";
        ResultSet res = Link.executeQuery(s);
        try
        {
            while(res.next())            
            {
                Integer idUsuario = res.getInt("idUsuario");
                return true;
            }
        } catch (SQLException ex)
        {
            return false;
        }
        return false;
    }
}
